< previous page page_669 next page >

Page 669
9f31265bb40b592b1929e18a47ab28e5.gif
Sub imaPicture_DragDrop (Index As Integer, _
           Source As Control, X As Single, Y As Single)
   If TypeOf Source Is ListBox Then
      If Source.Text = imaPicture(Index).Tag Then
         Source.RemoveItem Source.ListIndex
      End If
   End If
End Sub
To see this example completed, just load the sample project for this chapter and take a look at Drag5.frm (see Figure 32.6).
Examples Filename: Drag5.frm
8160-0669a.gif
Figure 32.6
The final example of drag and drop.
Summary
Drag and drop can add a nice alternative to the pure-keyboard approach for your users. It also makes your application conform to the Windows standard. For many controls, you can choose automatic mode, but for others, you need to program using the manual mode. Also, using an ImageList control is a great way to store the icons you might use for your drag-and-drop operations.
Review Questions
1. Which property sets the icon to use for the dragging operation?
2. Which property do you set to make the drag operation automatic?
3. Which event is fired when a control is dragged over another one?
4. What are the three states the DragOver() event can receive?

 
< previous page page_669 next page >

If you like this book, buy it!